package cn.com.nou.base.controller.account;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import cn.com.nou.base.service.account.AccountManageService;
import cn.com.nou.common.BaseController;
import cn.com.nou.common.entity.NouAccountInfo;
import cn.com.nou.common.entity.NouUserInfoT;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @ClassName: AccountManageController
 * @Description: 账号管理
 */
@RestController
@RequestMapping(path = "/accountManage")
@Api(description = "管理端-账号管理")
@Validated
public class AccountManageController extends BaseController {
	@Autowired
	private AccountManageService accountManageService;

	/**
	 * 
	 * @Title: getAccountInfo
	 * @Description: 获取账号信息
	 * @param nouAccountInfo
	 * @return
	 */
	@ApiOperation(value = "管理端-获取账号信息")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "userId", value = "管理员Id", required = true, dataType = "String", paramType = "body") })
	@PostMapping(path = "/getAccountInfo")
	@ResponseBody
	public NouAccountInfo getAccountInfo(@RequestBody NouAccountInfo nouAccountInfo) {
		return accountManageService.getAccount(nouAccountInfo.getUserId());
	}

	/**
	 * 
	 * @Title: upd
	 * @Description: 获取账号信息
	 * @param nouAccountInfo
	 * @return
	 */
//	@ApiOperation(value = "管理端-更新账号信息")
//	@ApiImplicitParams({
//			@ApiImplicitParam(name = "userId", value = "管理员Id", required = true, dataType = "String", paramType = "body"),
//
//			@ApiImplicitParam(name = "passWord", value = "密码", required = false, dataType = "String", paramType = "body"),
//			@ApiImplicitParam(name = "oldPassword", value = "原密码", required = false, dataType = "String", paramType = "body"),
//			@ApiImplicitParam(name = "address", value = "联系地址", required = false, dataType = "String", paramType = "body"),
//			@ApiImplicitParam(name = "avatar", value = "头像", required = false, dataType = "String", paramType = "body"),
//			@ApiImplicitParam(name = "contractPhone", value = "联系电话", required = false, dataType = "String", paramType = "body"),
//			@ApiImplicitParam(name = "email", value = "邮箱", required = false, dataType = "String", paramType = "body"),
//			@ApiImplicitParam(name = "note", value = "备注", required = false, dataType = "String", paramType = "body"),
//
//	})
//	@PostMapping(path = "/upd")
//	@ResponseBody
//	public void upd(@RequestBody NouUserInfoT nouUserInfoT) {
//		accountManageService.updAccount(nouUserInfoT);
//	}
}
